INCLUDES=lib

cabal:
	runghc Setup.lhs configure --user --prefix=`pwd` --bindir=`pwd`/bin/ &&\
        runghc Setup.lhs build && runghc Setup.lhs install 

cabal-static:
	runghc Setup.lhs configure --user --prefix=`pwd` --bindir=`pwd`/bin/ \
             --ghc-option="-optl-static" --ghc-option="-optl-pthread" &&\
	runghc Setup.lhs build && runghc Setup.lhs install 
	-rm -rf dist
	-rm -rf share

train-seminer: data/seminer/deu.train.lrec-2010-raw.model \
               data/seminer/deu.train.lrec-2010.model 

data/seminer/deu.train.lrec-2010.model: data/seminer/lrec-2010.features \
                                        data/seminer/deu.train.bio.brown \
                                        data/seminer/deu.testa.bio.brown
	./bin/sequor train data/seminer/lrec-2010.features \
         data/seminer/deu.train.bio.brown \
         data/seminer/deu.train.lrec-2010.model --hash \
         --heldout data/seminer/deu.testa.bio.brown  --iter 20 \
         --min-count 100 --rate 0.001 --beam 9

data/seminer/deu.train.lrec-2010-raw.model: data/seminer/lrec-2010-raw.features \
                                        data/seminer/deu.train.bio.raw.brown \
                                        data/seminer/deu.testa.bio.raw.brown
	./bin/sequor train data/seminer/lrec-2010-raw.features \
        data/seminer/deu.train.bio.raw.brown \
        data/seminer/deu.train.lrec-2010-raw.model --hash \
        --heldout data/seminer/deu.testa.bio.raw.brown  --iter 20 \
        --min-count 100 --rate 0.001 --beam 9


data/seminer/deu.train.bio.raw.brown: data/seminer/deu.train.bio \
                                      data/seminer/deu.eci.unlabeled.500+1000.classes
	cut -d' ' -f1,5 data/seminer/deu.train.bio |\
         ./bin/augment brown True data/seminer/deu.eci.unlabeled.500+1000.classes\
         > data/seminer/deu.train.bio.raw.brown

data/seminer/deu.testa.bio.raw.brown: data/seminer/deu.testa.bio \
                                      data/seminer/deu.eci.unlabeled.500+1000.classes
	 cut -d' ' -f1,5 data/seminer/deu.testa.bio |\
           ./bin/augment brown True data/seminer/deu.eci.unlabeled.500+1000.classes\
           > data/seminer/deu.testa.bio.raw.brown

data/seminer/deu.train.bio.brown: data/seminer/deu.train.bio \
                                      data/seminer/deu.eci.unlabeled.500+1000.classes
	cat data/seminer/deu.train.bio |\
         ./bin/augment brown True data/seminer/deu.eci.unlabeled.500+1000.classes\
         > data/seminer/deu.train.bio.brown

data/seminer/deu.testa.bio.brown: data/seminer/deu.testa.bio \
                                      data/seminer/deu.eci.unlabeled.500+1000.classes
	 cat data/seminer/deu.testa.bio |\
           ./bin/augment brown True data/seminer/deu.eci.unlabeled.500+1000.classes\
           > data/seminer/deu.testa.bio.brown

clean:
	-find . -name '*.o'  | xargs rm
	-find . -name '*.hi' | xargs rm

